<?php
class Test extends Zend_Db_Table{
	protected $_name = "ebook";
	
	
	public function getData()
	{
		$select = $this->_db->select();
    	$select->from("ebook");
    	
		$objTable = $select->query();
		return $objTable->fetchAll();
		
	}
	public function edit($id)
	{
		$objTable=$this->_db->query("Select * From ebook Where id=".$id);
		
		return $objTable->fetch();
	}
	public function admin_status($username)
	{
		$objTable=$this->_db->query("Select * From admin Where admin_fullname ='$username'");
		return $objTable->fetch();
	}
	public function employee($id)
	{
		$objTable=$this->_db->query("Select * From ebook Where admin_id=".$id);
		
		return $objTable->fetch();
	}
	public function search_data($search_tensach)
	{
		$objTable=$this->_db->query("Select * From ebook Where name LIKE '%%$search_tensach%%'");
		
		return $objTable->fetchAll();
	}
}
?>